{% extends '::base.html.twig' %} 
{% block module_name %}Compras{% endblock %}
{% block title %}Compras :: Editar{% endblock %}

{% block customScripts %}
<script src="{{ asset('bundles/EndorBundle/js/Endor.Compras.edit.js') }}"></script>
<script src="{{ asset('bundles/EndorBundle/js/jquery.dataTables.min.js') }}"></script>
{% endblock %}

{% block body2 %}

<div class="col_7_">
    <div class="widget clearfix">
        <h2>Compras :: Editar</h2>
        <div class="widget_inside records_list">
            <div class="form">
                <form action="{{ path('compras_update', { 'id': entity.id }) }}" method="post" {{ form_enctype(edit_form) }} id="formID">
                    {{ form_widget(edit_form) }}
                    <div class="clearfix">
                        <label>Fecha de Radicaci&oacute;n</label>
                        <div class="input">
                            <input type="text" name="fechaRadicacion" class="fecha validate[required]" value="{{entity.fecha.format("d/m/Y")}}"/>
                        </div>
                    </div>
                        {% include 'EndorBundle:HelperTemplates:ArticulosAgregados.edit.html.twig' with {'items': entity.ItemsCompras} %}    
                        <div class="clearfix grey-highlight">
                            <div class="input no-label">
                                <button type="submit" class="button blue">Guardar</button>
                            </div>
                        </div>
                    </form>
                    
                    <div class="margin_top_15 right">
                        <form action="{{ path('compras_delete', { 'id': entity.id }) }}" method="post" style="display: inline-block;">
                                {{ form_widget(delete_form) }}
                                <button type="submit" class="button black">Eliminar</button>
                        </form>
                        <a href="{{ path('compras') }}" class="button">Regresar a la Lista</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
<script>
$(document).ready(function(){
    $('.fecha').datetimepicker();
});
</script>
    {% include 'EndorBundle:HelperTemplates:ArticulosDisponibles.html.twig' with {'articulos': articulos} %}
{% endblock %}